import java.io.IOException;

import com.hp.hpl.jena.ontology.OntClass;
import com.hp.hpl.jena.ontology.OntModel;
import com.hp.hpl.jena.util.iterator.ExtendedIterator;

import edu.etu.sob.service.OntologyManager;


public class OntologyManagerTester {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		OntologyManager ontologyManager = new OntologyManager();
		try {
			OntModel model = ontologyManager.createOntologyModel("Ontologies/pizza.owl.rdf");
//			OntModel model = ontologyManager.createOntologyModel("http://www.co-ode.org/ontologies/pizza/pizza.owl");
			
			if (model == null) {
				System.err.println("model could not be read!");
				return;
			}
			
			ExtendedIterator<OntClass> classes = ontologyManager.listClasses(model);
			
			System.out.println("\nCLASSES:");
			System.out.println("---------");
			while(classes.hasNext()) {
				OntClass ontClass = classes.next();
				String label = ontClass.getLocalName();
				if (label != null)
					System.out.println(label);
			}
			
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
